<script setup lang="tsx">
import { DTable } from '@/components/DTable'
// import { BaseButton } from '@/components/Button'
import HeaderFilter from '@/components/DTable/src/Table/src/components/HeaderFilter.vue'
import {defineComponent} from "vue";
defineOptions({
  name: 'ExamplePage'
})
const table = {
    buttons:{
        add:'push://example/example-add', del:'/mock/example/delete'
    },
    url:{
        list: '/mock/example/list',
        del: '/mock/example/delete',
    },
    summary: '合计',
    columns:[
      {field:'title',width: 200,label:'标题',search:'input', filter:'string' ,edit:'/example/example-edit?id=$id', globalsort:true},
      {field:'title2',width: 200,label:'标题2'},
      {field:'title3',width: 200,label:'标题3'},
      {field:'title6',width: 200,label:'标题6'},
        /*sortable: true 当前页排序， 只排序当前页
        globalsort ：全局排序， 调用接口进行所有数据排序
        sortable 和 globalsort 一块设置 以 globalsort 为准*/
      {field:'author',label:'作者',  globalsort:true},
      {field:'display_time',label:'时间', width: 180, globalsort:true},
      {field:'importance',label:'重要性', sum: '合计'},
      {field:'pageviews',label:'展示树'},
    /*      {field:'opt',fixed:'left',width:'80px',label:t('tableDemo.action')
/*          ,table: {
                 slots: {
                   default: (data: any) => {
                     return (
                             <>
                               <BaseButton type="text" onClick={() => delData(data.row)}>
                                 {t('exampleDemo.del')}
                               </BaseButton>
                             </>
                     )
                   }
                 }
           }
      }*/
    ]
}
// eslint-disable-next-line vue/no-export-in-script-setup
// export default defineComponent({})
</script>

<template>
    <DTable  :table="table"  />
</template>

